export const order_table_ctl = [
  {
    label: '订单ID',
    prop: 'id',
    sortable: false,
    visiable: true,
  },
  // {
  //   label: '用户id',
  //   prop: 'user_id',
  //   sortable: false,
  //   visiable: true,
  // },
  {
    label: '用户名称',
    prop: 'user_name',
    sortable: false,
    visiable: true,
  },
  {
    label: '联系电话',
    prop: 'phone',
    sortable: false,
    visiable: true,
  },
  {
    label: '详细地址',
    prop: 'address',
    sortable: false,
    visiable: true,
  },
  {
    label: '推荐人',
    prop: 'referrer',
    sortable: false,
    visiable: true,
  },
  {
    label: '办理情况',
    prop: 'desc',
    sortable: false,
    visiable: true,
    width: 250,
  },
  // {
  //   label: '受理人id',
  //   prop: 'acceptor_id',
  //   sortable: false,
  //   visiable: true,
  // },
  {
    label: '受理人名称',
    prop: 'acceptor_name',
    sortable: false,
    visiable: true,
  },
  {
    label: '完成情况',
    prop: 'complete_desc',
    sortable: false,
    visiable: true,
    width: 250,

  },
  {
    label: '客户评星',
    prop: 'evaluation',
    sortable: false,
    visiable: true,
  },
  {
    label: '客户评价',
    prop: 'evaluation_desc',
    sortable: false,
    visiable: true,
    width: 250,
  },
  {
    label: '订单状态',
    prop: 'status',
    sortable: false,
    visiable: true,
    formatter: tableFormat,
  },
  {
    label: '备注',
    prop: 'remark',
    sortable: false,
    visiable: true,
  },
  {
    label: '更新时间',
    prop: 'update_time',
    sortable: false,
    visiable: true,
    formatter: tableFormat,
  },
  {
    label: '创建时间',
    prop: 'create_time',
    sortable: false,
    visiable: true,
    formatter: tableFormat,
  },
]


export const order_status_list = [
  // {
  //   value: '', // 空字符串表示显示所有数据
  //   label: '全部'
  // },
  {
    value: 0,
    label: '未受理'
  },
  {
    value: 1,
    label: '处理中'
  },
  {
    value: 2,
    label: '已完成'
  },
  {
    value: 3,
    label: '已拒绝'
  },
  {
    value: 4,
    label: '挂起'
  },

]

export const express_list = [
  // {
  //   value: '', // 空字符串表示显示所有数据
  //   label: '全部'
  // },
  {
    value: 0,
    label: '未发货'
  },
  {
    value: 1,
    label: '已发货'
  }
]

export const app_user_table_ctl = [
  {
    label: 'ID',
    prop: 'id',
    sortable: false,
    visiable: true,
  },
  {
    label: '用户名',
    prop: 'nick_name',
    sortable: false,
    visiable: true,
  },
  {
    label: '用户角色',
    prop: 'role',
    sortable: false,
    visiable: true,
    formatter: tableFormat,

  },
  {
    label: '更新时间',
    prop: 'update_time',
    sortable: false,
    visiable: true,
    formatter: tableFormat,
  },
  {
    label: '创建时间',
    prop: 'create_time',
    sortable: false,
    visiable: true,
    formatter: tableFormat,
  },
]

let status_label = ['未受理', '处理中', '已完成', '已拒绝', '挂起']
let role_list = {admin: '管理员', acceptor: '受理人'}

function tableFormat(row, column, index) {
  // console.log(row, column, index)
  let str = ''
  switch (column.property) {
    case 'update_time':
      str = row.update_time ? row.update_time.slice(0, 10) : ''
      break
    case 'create_time':
      str = row.create_time.slice(0, 10)
      break
    case 'actual_paid':
      str = row.actual_paid / 100
      break
    case 'start_date':
      str = row.start_date.slice(0, 7)
      break
    case 'end_date':
      str = row.end_date.slice(0, 7)
      break
    case 'status':
      str = status_label[row.status]
      break
    case 'role':
      str = row.role ? role_list[row.role] : '用户'
      break

  }
  return str
}

// 以下数据作展示用
export const default_table_ctl = [
  {
    label: 'ID',
    prop: 'id',
    sortable: false,
    visiable: true,
  },
  {
    label: '名称',
    prop: 'name',
    sortable: false,
    visiable: true,
  },
  {
    label: '用户名',
    prop: 'username',
    sortable: false,
    visiable: true,
  },
  {
    label: '更新时间',
    prop: 'updateTime',
    sortable: false,
    visiable: true,
    formatter: tableFormat,
  },
  {
    label: '创建时间',
    prop: 'createTime',
    sortable: false,
    visiable: true,
    formatter: tableFormat,
  },
]
// 以下数据作展示用
export const dict_table_ctl = [
  {
    label: 'ID',
    prop: 'id',
    sortable: false,
    visiable: true,
  },
  {
    label: '参数名称',
    prop: 'name',
    sortable: false,
    visiable: true,
  },
  {
    label: '参数数值',
    prop: 'content',
    sortable: false,
    visiable: true,
  },
  // {
  //   label: '更新时间',
  //   prop: 'updateTime',
  //   sortable: false,
  //   visiable: true,
  //   formatter: tableFormat,
  // },
  // {
  //   label: '创建时间',
  //   prop: 'createTime',
  //   sortable: false,
  //   visiable: true,
  //   formatter: tableFormat,
  // },
]
